deploy: Handle a read-only /boot
authorColin Walters <walters@verbum.org>
Mon, 21 Mar 2016 14:37:38 +0000 (10:37 -0400)
committerColin Walters <walters@verbum.org>
Mon, 21 Mar 2016 16:49:05 +0000 (12:49 -0400)
commit8894bb39498267f4ae06badc7aa54c4eb4bb7f73
treefd6704c0bc6320131cdb7813dd8c8d7581e95558
parentb842429bf2c5a7a4e41a8a53d54086a02bf216e1
deploy: Handle a read-only /boot

I'd like to encourage people to make OSTree-managed systems more
strictly read-only in multiple places.  Ideally everywhere is
read-only normally besides `/var/`, `/tmp/`, and `/run`.

`/boot` is a good example of something to make readonly.  Particularly
now that there's work on the `admin unlock` verb, we need to protect
the system better against things like `rpm -Uvh kernel.rpm` because
the RPM-packaged kernel won't understand how to do OSTree right.

In order to make this work of course, we *do* need to remount `/boot`
as writable when we're doing an upgrade that changes the kernel
configuration.  So the strategy is to detect whether it's read-only,
and if so, temporarily mount read-write, then remount read-only when
the upgrade is done.

We can generalize this in the future to also do `/etc` (and possibly
`/sysroot/ostree/` although that gets tricky).

One detail: In order to detect "is this path a mountpoint" is
nontrivial - I looked at copying the systemd code, but the right place
is to use `libmount` anyways.
Makefile-libostree.am
configure.ac
docs/manual/atomic-upgrades.md
src/libostree/ostree-sysroot-deploy.c